﻿using Microsoft.AspNetCore.Mvc;


namespace ToolMonitoring.WebApi.Controllers
{
	[ApiController]
	[Route("api/[controller]/[action]")]
	[DisableAuditing]
	public class AuditLogController:ControllerBase
	{
		private readonly AuditLogService _auditLogService;
		private readonly ILogger<AuditLogController> _logger;
		
		public AuditLogController(AuditLogService auditLogService,
ILogger<AuditLogController> logger)
		{
			_auditLogService = auditLogService;
			_logger = logger;
		}

		[HttpPost]
		public async Task<PageResult<AuditLog>> FindAll(AuditLogPageQueryDto input)
		{
			_logger.LogInformation("查询升级日志");
			// Expression<Func<AuditInfo, bool>> query = audit => audit.MethodName.Contains(input.MethodName??"");
			var data = new AuditLog();
			data.MethodName = input.MethodName;
			return await this._auditLogService.Find(data, input.PageIndex, input.PageSize); 
		}

	}
}
